package com.otoe.dilidilivid.view.fragment;

import android.content.Intent;
import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.otoe.dilidilivid.R;
import com.otoe.dilidilivid.view.activity.CollectionActivity;
import com.otoe.dilidilivid.view.activity.ConcernActivity;
import com.otoe.dilidilivid.view.activity.FansActivity;
import com.otoe.dilidilivid.view.activity.HistoryActivity;
import com.otoe.dilidilivid.view.activity.MyvideoActivity;

/**
 * A simple {@link Fragment} subclass.
 * Use the {@link FragmentMy#newInstance} factory method to
 * create an instance of this fragment.
 */
public class FragmentMy extends Fragment {

    // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
    private static final String ARG_PARAM1 = "param1";
    private static final String ARG_PARAM2 = "param2";

    private String mParam1;
    private String mParam2;
    private TextView tv1;
    private TextView tv2;
    private TextView tv3;
    private TextView tv4;
    private TextView tv5;
    private TextView my_name;

    public FragmentMy() {
        // Required empty public constructor
    }

    /**
     * Use this factory method to create a new instance of
     * this fragment using the provided parameters.
     *
     * @param param1 Parameter 1.
     * @param param2 Parameter 2.
     * @return A new instance of fragment FragmentMy.
     */
    // TODO: Rename and change types and number of parameters
    public static FragmentMy newInstance(String param1, String param2) {
        FragmentMy fragment = new FragmentMy();
        Bundle args = new Bundle();
        args.putString(ARG_PARAM1, param1);
        args.putString(ARG_PARAM2, param2);
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
            mParam1 = getArguments().getString(ARG_PARAM1);
            mParam2 = getArguments().getString(ARG_PARAM2);
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_my, container, false);
        // Inflate the layout for this fragment
        tv1 = (TextView) view.findViewById(R.id.tv_collection);
        tv1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(getContext(), CollectionActivity.class));
            }
        });


//        tv2.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                startActivity(new Intent(getContext(), HistoryActivity.class));
//            }
//        });


//        tv3.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                startActivity(new Intent(getContext(), MyvideoActivity.class));
//
//            }
//        });

        tv4 = (TextView) view.findViewById(R.id.tv_fo);
        tv4.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(getContext(), ConcernActivity.class));
            }
        });

        tv5 = (TextView) view.findViewById(R.id.tv_fa);
        tv5.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(getContext(), FansActivity.class));
            }
        });

        return view;
    }
}